package com.aspose.cells.a.d;

public class zfj implements Cloneable {
   public int[] a = new int[16];
   public Object[] b = new Object[16];
   private int c;

   public void a(int var1, Object var2) {
      int var3 = zr.a(this.a, 0, this.c, var1);
      if (var3 >= 0) {
         throw new IllegalArgumentException("duplicate");
      } else {
         this.a(~var3, var1, var2);
      }
   }

   public void a(int var1) {
      if (var1 != this.a.length) {
         if (var1 < this.c) {
            throw new IllegalArgumentException("Parameter name: value");
         }

         if (var1 > 0) {
            int[] var2 = new int[var1];
            Object[] var3 = new Object[var1];
            if (this.c > 0) {
               System.arraycopy(this.a, 0, var2, 0, this.c);
               System.arraycopy(this.b, 0, var3, 0, this.c);
            }

            this.a = var2;
            this.b = var3;
         } else {
            this.a = new int[16];
            this.b = new Object[16];
         }
      }

   }

   public int a() {
      return this.c;
   }

   public boolean b(int var1) {
      return this.f(var1) >= 0;
   }

   private void g(int var1) {
      int var2 = this.a.length == 0 ? 16 : this.a.length * 2;
      if (var2 < var1) {
         var2 = var1;
      }

      this.a(var2);
   }

   public Object c(int var1) {
      if (var1 >= 0 && var1 < this.c) {
         return this.b[var1];
      } else {
         throw new IllegalArgumentException("Parameter name: index");
      }
   }

   public int d(int var1) {
      if (var1 >= 0 && var1 < this.c) {
         return this.a[var1];
      } else {
         throw new IllegalArgumentException("Parameter name: index");
      }
   }

   public Object e(int var1) {
      int var2 = this.f(var1);
      return var2 >= 0 ? this.b[var2] : null;
   }

   public void b(int var1, Object var2) {
      int var3 = zr.a(this.a, 0, this.c, var1);
      if (var3 >= 0) {
         this.b[var3] = var2;
      } else {
         this.a(~var3, var1, var2);
      }
   }

   public int f(int var1) {
      int var2 = zr.a(this.a, 0, this.c, var1);
      return var2 >= 0 ? var2 : -1;
   }

   private void a(int var1, int var2, Object var3) {
      if (this.c == this.a.length) {
         this.g(this.c + 1);
      }

      if (var1 < this.c) {
         System.arraycopy(this.a, var1, this.a, var1 + 1, this.c - var1);
         System.arraycopy(this.b, var1, this.b, var1 + 1, this.c - var1);
      }

      this.a[var1] = var2;
      this.b[var1] = var3;
      ++this.c;
   }
}
